Summarization Service Documentation
This is the Summarization Service
Paths
/summarization/api/v1/healthz
GET /summarization/api/v1/healthz
Summary: Health
Description: Return Health Status.
Responses:
- 200: Successful Response
- Content: application/json
- Schema: Msg
/summarization/api/v1/docs
POST /summarization/api/v1/docs
Summary: Generate Summarization
Description: Generate summarization for the provided source text.
Request Body:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Query Parameter | source_text | text to be summarized. | string | mandatory |
Query Parameter | language_style | Select the language style for the summary. | string (enum) | mandatory |
Query Parameter | summary_format | Format of the summary (paragraph or key points). | string (enum) | mandatory |
Query Parameter | model | Model to use for summarization. | string (enum) | mandatory |
Query Parameter | file_name | Name of the file being summarized. | string | optional |
Sample Code:
import requests
# Define the API endpoint and the payload
url = "https://api-genai-dev.learningmate.co/summarization/api/v1/text"
headers = {
"accept": "application/json",
"Authorization": "Bearer {Your Token Here}", # Replace {Your Token Here} with your actual token
}
data = {
"source_text": "Your source text will be given as input."
"language_style": (None, "Formal"),
"summary_format": (None, "Paragraph"),
"model": (None, "gpt-4o-mini")
}
# Make the POST request
response = requests.post(url, headers=headers, data=data)
# Print the response
if response.status_code == 200:
print("Response Data:", response.json())
else:
print("Failed to call the API. Status Code:", response.status_code)
print("Response Text:", response.text)
Example response:
{
"status_code": 200,
"message": "Success: Summarization generated successfully.",
"summary": "Summarized text here"
}
Responses:
Status Code | Description | Content-Type | Details |
---|---|---|---|
200 | Translation generated | application/json | Successful Response - Status retrieved successfully |
400 | Bad Request | application/json | Bad Request - Invalid format |
401 | Authentication failed | application/json | Unauthorized - Invalid or missing authentication token |
404 | Model not found | application/json | Model not found - Invalid model. |
422 | Validation Error | application/json | Schema: HTTPValidationError |
500 | Internal server error | application/json | An error occurred while generating the summarization : [error details]. |
Components
Schemas
- Msg
- SummarizationRequest
- HTTPValidationError